import { BrowserRouter, Routes, Route } from 'react-router-dom'
import routers from './setup'
import PageTitle from '@/components/FancyRoute'
export default () => {
  return (
    <BrowserRouter>
      <Routes>
        {routers.map((route: any) => (
          <Route key={route.path} path={route.path} element={<PageTitle route={route} />}>
            {route.children && route.children.map((child: any) => <Route key={child.path} path={child.path} element={<PageTitle route={route} />} />)}
          </Route>
        ))}
      </Routes>
    </BrowserRouter>
  )
}
